ListBox.CellTextPaint Event

The parameter g is a Graphics object that corresponds to the text drawing area of the cell Row, Column. This does not necessarily correspond to the entire cell content area, for example, if you use a row picture in the cell. The parameters x and y are the coordinates of the suggested ideal location to draw text based on the current value of ColumnAlignment or CellAlignment, as well as the cell's font, font size, and font style. Returns a Boolean.

Syntax

CellTextPaint ( g, Row, Column, x, y )

Parameters

g

Graphics

Row

Integer

Column

Integer

x

Integer

y

Integer



The drawing order of the cell is as follows, with the background first:

Background

Disclosure Triangle/Treebox

Checkbox

RowPicture

Text

Border

Although the border is painted last, it isn't advisable to change the state of the border in the CellTextPaint event since the area is determined by the size of the border before the cell is painted and so it could leave unpainted areas, or possibly cover up some of the painting you have done.

True means the user has handled the text paint and no other processing is to be done with the text. In this case, the user is responsible for text highlighting. Text highlighting is currently only done for the hierarchical listbox style. False means the user wants REALbasic to paint the text. REALbasic will attempt to highlight the text as appropriate (according to the platform, and the hierarchical style).